







Algorithms..::LexicographicalCompare<(Of <T>)> Method (IEnumerable<(Of <T>)>, IEnumerable<(Of <T>)>, IComparer<(Of <T>)>) |
See Also |
![]() ![]() |
[This topic is pre-release documentation and is subject to change in future releases. Blank topics are included as placeholders.]
Performs a lexicographical comparison of two sequences of values, using a supplied comparer interface. A lexicographical comparison compares corresponding
pairs of elements from two sequences in order. If the first element of sequence1 is less than the first element of sequence2,
then the comparison ends and the first sequence is lexicographically less than the second. If the first elements of each sequence
are equal, then the comparison proceeds to the second element of each sequence. If one sequence is shorter than the other,
but corresponding elements are all equal, then the shorter sequence is considered less than the longer one.
Namespace: Wintellect.PowerCollections
Assembly:
PowerCollections (in PowerCollections.dll)
Syntax
C# |
---|
public static int LexicographicalCompare<T>( IEnumerable<T> sequence1, IEnumerable<T> sequence2, IComparer<T> comparer ) |
Visual Basic (Declaration) |
---|
Public Shared Function LexicographicalCompare(Of T) ( _ sequence1 As IEnumerable(Of T), _ sequence2 As IEnumerable(Of T), _ comparer As IComparer(Of T) _ ) As Integer |
Visual C++ |
---|
public: generic<typename T> static int LexicographicalCompare ( IEnumerable<T>^ sequence1, IEnumerable<T>^ sequence2, IComparer<T>^ comparer ) |
Parameters
- sequence1
- IEnumerable<(Of <T>)>
The first sequence to compare.
- sequence2
- IEnumerable<(Of <T>)>
The second sequence to compare.
- comparer
- IComparer<(Of <T>)>
The IComparer<T> used to compare items. Only the Compare member function of this interface is called.
Return Value
Less than zero if sequence1 is lexicographically less than sequence2. Greater than zero if sequence1 is lexicographically greater than sequence2. Zero if sequence1 is equal to sequence2.
Type Parameters
- T
- Types of items to compare.
Exceptions
Exception | Condition |
---|---|
System..::ArgumentNullException | sequence1, sequence2, or comparer is null. |
See Also
Algorithms Class
Wintellect.PowerCollections Namespace